package com.example.controller;

import com.example.service.UserOrderService;
import com.example.vo.resp.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "订单模块")
@RequestMapping("/order")
@RestController
public class OrderController {

    @Autowired
    UserOrderService userOrderService;

    @GetMapping("/change")
    public Result change() {
        userOrderService.change();
        return Result.SUCCESS();
    }

    @GetMapping("/testRequired")
    public Result testTranRequired() {
        userOrderService.testTranRequired();
        return Result.SUCCESS();
    }

    @GetMapping("/testRequiredNew")
    public Result testTranRequiredNew() {
        userOrderService.testTranRequiredNew();
        return Result.SUCCESS();
    }

    @GetMapping("/testNever")
    public Result testTranNever() {
        userOrderService.testTranNever();
        return Result.SUCCESS();
    }

    @GetMapping("/testNested")
    public Result testTranNested() {
        userOrderService.testTranNested();
        return Result.SUCCESS();
    }

    @GetMapping("/testNested2")
    public Result testTranNested2() {
        userOrderService.testTranNested2();
        return Result.SUCCESS();
    }
}
